{extend name="iframe" /}
{block name="body"}
{if condition="!empty($data.kid)"}
<div>
    <ul class="layui-nav" lay-filter="">
        <li class="layui-nav-item layui-this"><a onclick="clickInfo()">基本信息</a></li>
        <li class="layui-nav-item"><a onclick="clickResume()">履历</a></li>
        <li class="layui-nav-item"><a onclick="clickReward()">奖惩信息</a></li>
    </ul>
</div>
{/if}
<div class="layui-card">
    <div class="layui-card-body">
        <input type="hidden" id="id" name="id" value="{$data.id|default=''}" />
        <input type="hidden" id="kid" name="kid" value="{$data.kid|default=''}" />
        <form action="{:request()->url()}" class="layui-form" method="post">
            <div class="layui-form-item">
                <label class="layui-form-label">* 姓名</label>
                <div class="layui-input-block">
                    <input type="text" name="scholar_name" value="{$data.scholar_name|default=''}" autocomplete="off" placeholder="请输入学者姓名" lay-verify="required" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">* 学者编号</label>
                <div class="layui-input-block">
                    <input type="text" name="kid" value="{$data.kid|default=''}" autocomplete="off" placeholder="请输入学者编号" lay-verify="required" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">* 机构</label>
                <div class="layui-input-block">
                    <input type="text" name="institute" value="{$data.institute|default=''}" autocomplete="off" placeholder="请输入机构" lay-verify="required" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">入职时间</label>
                <div class="layui-input-block">
                    <input type="text" id="entrant_time" name="entrant_time" value="{$data.entrant_time|default=''}" autocomplete="off" placeholder="请输入入职时间" readonly class="layui-icon-date">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">性别</label>
                <div class="layui-input-block">
                    <select name="sex">
                        <option>未知</option>
                        <option value="1" {if condition="isset($data) and $data.sex eq 1 or input('sex') eq 1" }selected="selected"{/if}>男</option>
                        <option value="2" {if condition="isset($data) and $data.sex eq 2 or input('sex') eq 2" }selected="selected"{/if}>女</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">邮箱</label>
                <div class="layui-input-block">
                    <input type="text" name="email" value="{$data.email|default=''}" autocomplete="off" placeholder="请输入邮箱" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">手机号</label>
                <div class="layui-input-block">
                    <input type="text" name="phone" value="{$data.phone|default=''}" autocomplete="off" placeholder="请输入手机号" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">* 职称</label>
                <div class="layui-input-block">
                    <input type="text" name="professional_title" value="{$data.professional_title|default=''}" autocomplete="off" placeholder="请输入职称" lay-verify="required" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-filter="i" lay-submit="">保存</button>
                    <button class="layui-btn layui-btn-primary" type="reset">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>
{/block}
{block name="js"}
    <script>
        function clickInfo() {
            var id = $('#id').val();
            var kid = $('#kid').val();
            location.href = '/admin/scholar/edit?id=' + id + '&kid=' + kid
        }

        function clickResume() {
            var id = $('#id').val();
            var kid = $('#kid').val();
            location.href = '/admin/scholar/resumeDetail?id=' + id + '&kid=' + kid
        }

        function clickReward() {
            var id = $('#id').val();
            var kid = $('#kid').val();
            location.href = '/admin/scholar/toRewardAndPunish?id=' + id + '&kid=' + kid
        }

        laydate.render({
            elem: '#entrant_time',
            type: 'datetime'
        })
    </script>
{/block}
